﻿using PetaPoco;
using PmSoft;
using PmSoft.Caching;
using System.ComponentModel;

namespace Modules.Cms.Entitys
{
    [TableName("cms_custom")]
    [Description("客户基础信息表")]
    [PrimaryKey("id", AutoIncrement = true)]
    [CacheSetting(true)]
    [Serializable]
    public class CmsCustom:IDelEntity
    {

        /// <summary>
        /// 主键
        /// </summary>
        [Column("id")]
        public int Id { get; set; }

        /// <summary>
        /// 创建人ID
        /// </summary>
        [Column("create_user_id")]
        public int CreateUserId { get; set; }

        /// <summary>
        /// 创建人名称
        /// </summary>
        [Column("create_user_name")]
        public string CreateUserName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        [Column("create_dt")]
        public DateTime CreateDt { get; set; }

        /// <summary>
        /// 更新人ID
        /// </summary>
        [Column("update_user_id")]
        public int UpdateUserId { get; set; }

        /// <summary>
        /// 更新人名称
        /// </summary>
        [Column("update_user_name")]
        public string UpdateUserName { get; set; }

        /// <summary>
        /// 更新时间
        /// </summary>
        [Column("update_dt")]
        public DateTime UpdateDt { get; set; }

        /// <summary>
        /// 删除标识
        /// </summary>
        [Column("is_deleted")]
        public bool IsDeleted { get; set; }
        /// <summary>
        /// 客户姓名
        /// </summary>
        [Column("name")]
        public string Name { get; set; }

        /// <summary>
        /// 客户电话
        /// </summary>
        [Column("phone")]
        public string Phone { get; set; }
        /// <summary>
        /// 身份证号
        /// </summary>
        [Column("card_no")]
        public string? CardNo { get; set; }
        /// <summary>
        /// 区域id
        /// </summary>
        [Column("area_id")]
        public int AreaId { get; set; }

        /// <summary>
        /// 客户地址
        /// </summary>
        [Column("address")]
        public string Address { get; set; }

        /// <summary>
        /// 归属经销商id
        /// </summary>
        [Column("dealer_id")]
        public int DealerId { get; set; }


        [Ignore]
        bool IDelEntity.IsDeletedInDatabase { get => IsDeleted; set => IsDeleted = value; }

        #region IEntity 成员

        [Ignore]
        object IEntity.EntityId { get { return this.Id; } }

        #endregion IEntity 成员
    }
}
